package cn.tedu.factory.method;

/**
 * 客户端程序
 */
public class Test {
    public static void main(String[] args) {
        WeaponFactory weaponFactory = new DaggerFactory();
        Weapon dagger = weaponFactory.get();
        dagger.attack();
      /*  WeaponFactory weaponFactory = new GunFactory();
        weaponFactory.get().attack();

        WeaponFactory weaponFactory2 = new DaggerFactory();
        weaponFactory2.get().attack();*/

        WeaponFactory weaponFactory2 = new GunFactory();
        Weapon gun = weaponFactory2.get();
        gun.attack();

    }
}
